package com.heima.apis.article.fallback;

import com.heima.apis.article.IArticleClient;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class IArticleClientFallback implements IArticleClient {
    //降级  一旦wemedia调用article报错或者超时  wemedia会调用该方法拿到降级结果   需要开启
    @Override
    public ResponseResult saveArticle(ArticleDto dto) {
        log.warn("走降级了");
        return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR,"获取数据失败");
    }
}
